import EventRoute from "./EventRoute"
import SystemProductService from "../service/SystemProductService";

const routes = new Array();
const systemProductService = new SystemProductService();
/**
 * 产品分页
 */
routes.push(
    new EventRoute('app-product-page', 'event', async (api, data = {}) => {
        systemProductService.page(data.data)
    })
)

/**
 * 产品添加
 */
routes.push(
    new EventRoute('app-product-add', 'event', async (api, data = {}) => {
        systemProductService.save(data.data)
    })
)

/**
 * 产品修改
 */
routes.push(
    new EventRoute('app-product-update', 'event', async (api, data = {}) => {
        systemProductService.updateById(data.data)
    })
)

/**
 * 产品删除
 */
routes.push(
    new EventRoute('app-product-delete', 'event', async (api, data = {}) => {
        systemProductService.deleteById(data.data)
    })
)

export default routes;
